﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bsznq.Repositories
{
    public interface IRepositoryBase<TEntity> where TEntity : class
    {
        #region 新增

        bool Insert(TEntity t);

        bool Insert(List<TEntity> t);

        #endregion

        #region 删除

        bool Delete(object id);

        bool Delete(string sql, object parameters = null);

        bool Delete(List<TEntity> list);

        #endregion

        #region 修改

        bool Update(TEntity t);

        bool Update(List<TEntity> t);

        #endregion

        #region 查询

        TEntity SelectById(object id);

        TEntity Select(string sql, object parameters = null);

        T Select<T>(string sql, object parameters = null);

        List<TEntity> SelectList(string sql, object parameters = null);

        List<TEntity> SelectAll();

        #endregion

        bool Execute(string sql, object parameters = null);

    }
}
